/**
 * @Author: Bobby
 * @Date: 2022-03-09 14:40:46
 * @LastEditTime: 2022-03-22 17:35:19
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\eventTask\actions\layer\closeLayerId.js
 * @CIMC-V2
 */
import { findPrevParent } from '@ve/utils/utils'
export function closeLayerId(vm, layerId) {
  let getNowPageData = vm.$store.getters['preview/getNowPageData']
  //查找图层id的父级
  let parentObj = findPrevParent([getNowPageData], layerId, '_id', 'list')
  if (parentObj) {
    parentObj.hasSubPageShow = false
    parentObj.data = {}
    if (parentObj.subPage.info && parentObj.subPage.info.data) {
      parentObj.subPage.info.data.requestData = {}
    }
    parentObj.subPage.info = {}
    console.log('关闭')
    vm.$pub(`SplitpaneResized`, true)
  }
}
